﻿using System;
using System.Collections.Generic;
using System.Text;
using FingerTip.Infrastructure.NotifyMessager;
using FingerTip.Infrastructure.NotifyMessager.Event;

namespace FingerTip.UnitTest.NotifyMessager
{
    public class NotifyMessageRegister
    {
        internal static void Register()
        {
            NotifyMessagePublisher.Register(NotifyMessageHandler.HandlerCodeReviewFailureNotify);
            NotifyMessagePublisher.Register(NotifyMessageHandler.HandlerUserChanged);
        }


    }

    public class NotifyMessageHandler
    {
        internal static void HandlerCodeReviewFailureNotify(MessageEventArgs args)
        {

            var message = MessageFactory.GetMessageContent(MessageType.CodeReviewFailureNotify, args);
            Messager.Instance.Send(message);

        }


        /// <summary>
        /// 处理当前处理人流转事件
        /// </summary>
        /// <param name="args"></param>
        internal static void HandlerUserChanged(MessageEventArgs args)
        {
            var message = MessageFactory.GetMessageContent(MessageType.CodeReviewFailureNotify, args);
            Messager.Instance.Send(message);
        }
    }
}
